﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Common/Master/PopupDiv.master" AutoEventWireup="true" CodeBehind="Edit.aspx.cs" Inherits="Jzy.Web.Forum.Member.Edit" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script type="text/javascript" src="../../Common/Js/tab2.js"></script>
    <script type="text/javascript" src="../../Common/Js/Calendar.js"></script>
    <style type="text/css">
        .style0
        {
            display:none;
            margin-left: 10px; margin-right: 10px;
            height: 232px; 
            
        }
        .style0 table
        {
            margin-top:10px;
        }
        .style1
        {
            text-align:right; padding-right:5px; width:80px;
        }
        .style3
        {
            text-align:right; padding-right:5px; width:70px;
        }
        .style2,.style4
        {
            width:130px;
        }
    </style>
<script type="text/javascript">
    function validate()
    {
        var txtName = $("#<%=LoginName.ClientID %>");
        var txtPassword = $("#<%=txtPassword.ClientID %>");
        var txtMobile = $("#<%=Mobile.ClientID %>");
        var txtEmail = $("#<%=Email.ClientID %>");
        var txtCredits = $("#<%=Credits.ClientID %>");

        var name = $.trim(txtName.val());
        var password = $.trim(txtPassword.val());
        var mobile = $.trim(txtMobile.val());
        var email = $.trim(txtEmail.val());
        var credits = $.trim(txtCredits.val());

        if (name == "")
        {
            alert("请输入用户登录名");
            txtName.get(0).focus();
            return false;
        }
        if (password.length < 6)
        {
            alert("密码长度不得少于6位");
            txtPassword.get(0).focus();
            return false;
        }
        if (mobile == "")
        {
            alert("请输入手机号码");
            txtMobile.get(0).focus();
            return false;
        }
        if (email == "")
        {
            alert("请输入电子邮件");
            txtEmail.get(0).focus();
            return false;
        }
        else
        {
            if (email.indexOf("@") < 0)
            {
                alert("电子邮件格式不正确");
                txtEmail.get(0).focus();
                return false;
            }
        }
        var reg = /^\d*$/;
        if (!reg.test(credits))
        {
            alert("积分格式不正确");
            txtCredits.get(0).focus();
            return false;
        }

        return true;
       
    }
    $(document).ready(
    function()
    {
        $("form").bind("submit", function()
        {
            return validate();
        });
    });
</script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<div style="height:10px; line-height:10px;"></div>
    <div id="top_daohang" class="tab2" style="margin-left: 10px; margin-right: 10px;">
        <ul>
            <asp:Repeater ID="rpt" runat="server" EnableViewState="false">
                <ItemTemplate>
                    <li>
                        <div class="menu_l">
                        </div>
                        <div class="menu_r">
                        </div>
                        <a id='lnk_<%#Eval("ID") %>' onclick='setFocus(this)'>
                            <%#Eval("Name") %></a> </li>
                </ItemTemplate>
            </asp:Repeater>
        </ul>
    </div>
    <asp:Panel ID="pnlMain" runat="server">
        <div id="div0" class="tab2_content style0">
            <table cellpadding="0" cellspacing="0" border="0" width="100%" style="height:180px;">
                <tr>
                    <td class="style1"><span style="color:Red;">*</span>&nbsp;登录名：</td>
                    <td class="style2">
                        <asp:TextBox ID="LoginName" runat="server" CssClass="txt" Width="100px"></asp:TextBox></td>
                    <td class="style3"><span style="color:Red;">*</span>&nbsp;密码：</td>
                    <td class="style4">
                        <asp:TextBox ID="txtPassword" runat="server" CssClass="txt" Width="100px" TextMode="Password"></asp:TextBox>
                        <asp:HiddenField ID="hidPassword" runat="server" />
                        </td>
                </tr>
                <tr>
                    <td class="style1">昵称：</td>
                    <td class="style2">
                        <asp:TextBox ID="Name" runat="server" CssClass="txt" Width="100px"></asp:TextBox></td>
                    <td class="style3">用户组：</td>
                    <td class="style4">
                        <asp:DropDownList ID="GroupID" runat="server" Width="100px">
                        </asp:DropDownList>
                    </td>
                </tr>
                <tr>
                    <td class="style1"><span style="color:Red;">*</span>&nbsp;手机：</td>
                    <td class="style2">
                        <asp:TextBox ID="Mobile" runat="server" CssClass="txt" Width="100px"></asp:TextBox>
                    </td>
                    <td class="style3">状态：</td>
                    <td class="style4">
                        <asp:DropDownList ID="State" runat="server" Width="100px">
                        </asp:DropDownList>
                    </td>
                </tr>
                <tr>
                    <td class="style1"><span style="color:Red;">*</span>&nbsp;电子邮件：</td>
                    <td class="style2" colspan="3">
                        <asp:TextBox ID="Email" runat="server" CssClass="txt" Width="300px"></asp:TextBox></td>
                    
                </tr>
            </table>
        </div>
        <div id="div1" class="tab2_content style0">
           <table cellpadding="0" cellspacing="0" border="0" width="100%">
                <tr>
                    <td class="style1">身份证号：</td>
                    <td class="style2">
                        <asp:TextBox ID="IDCard" runat="server" CssClass="txt"></asp:TextBox></td>
                    <td class="style3">性别：</td>
                    <td class="style4">
                        <asp:RadioButtonList ID="Gender" runat="server" RepeatDirection="Horizontal">
                        </asp:RadioButtonList>
                    </td>
                </tr>
                <tr>
                    <td class="style1">固定电话：</td>
                    <td class="style2">
                        <asp:TextBox ID="Telephone" runat="server" CssClass="txt"></asp:TextBox></td>
                    <td class="style3">生日：</td>
                    <td class="style4">
                        <asp:TextBox ID="Birthday" runat="server" CssClass="txt" Width="80px"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td class="style1">QQ：</td>
                    <td class="style2">
                        <asp:TextBox ID="QQ" runat="server" CssClass="txt"></asp:TextBox>
                    </td>
                    <td class="style3">积分：</td>
                    <td class="style4">
                        <asp:TextBox ID="Credits" runat="server" CssClass="txt" Width="80px"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td class="style1">MSN：</td>
                    <td class="style2" colspan="3">
                        <asp:TextBox ID="MSN" runat="server" CssClass="txt" Width="300px"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td class="style1">头像：</td>
                    <td colspan="3">
                        <asp:FileUpload ID="fileHeadImage" runat="server" CssClass="txt" />
                        <img alt="" src="" style="height:20px;" />
                    </td>
                </tr>
                <tr>
                    <td class="style1">签名：</td>
                    <td colspan="3">
                        <asp:TextBox ID="Signs" runat="server" TextMode="MultiLine" CssClass="txt" Width="300px" Height="50px"></asp:TextBox></td>
                    
                </tr>
            </table>
        </div>
    </asp:Panel>
    <div style="height:20px;"></div>

    <script type="text/javascript">
        //addEvent();
        //initFirstTab(0);
        setFocus(document.getElementById("lnk_0"));
    </script>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder2" runat="server">
<asp:Button ID="btnSave" runat="server" OnClick="btnSave_Click" Text="保存" />
</asp:Content>

